package com.wwx.worldonwheels.controller;

import com.wwx.worldonwheels.common.result.CommonResult;
import com.wwx.worldonwheels.service.CarReturnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: CarReturnController
 * Description:
 * CreatedBy: HuaHX
 */
@RestController
public class CarReturnController {
    @Autowired(required = false)
    private CarReturnService carReturnService;

    @RequestMapping(value = "/ReturnCar", method = RequestMethod.POST)
    public Object returnCar(@RequestParam(value = "serviceId") Integer serviceId,
                                  @RequestParam(value = "endMile") Integer endMile,
                                 @RequestParam(value="paymentMethod") String paymentMethod,
                                 @RequestParam(value="coupId",required = false,defaultValue = "NoCoupon") String coupId,
                          @RequestParam(value="cardNo")  Integer cardNo) {
        return carReturnService.ReturnCar(serviceId, endMile, paymentMethod, coupId,cardNo);
    }
}


